import Request from "@/util/request.js";

const apiRequest = new Request();

// 获取部门树
export const getDepartmentTreeApi = async () => {
    return await apiRequest.post("/api/ucenter.department/getTree");
}

// 添加部门
export const addDepartmentApi = async (data) => {
    return await apiRequest.post("/api/ucenter.department/create", data);
}

// 编辑部门
export const updateDepartmentApi = async (data) => {
    return await apiRequest.post("/api/ucenter.department/save", data);
}

// 获取用户列表
export const getUserListApi = async (data) => {
    return await apiRequest.post("/api/ucenter.user/index", data);
}

// 获取picker列表
export const getUserPickerApi = async (data) => {
    return await apiRequest.post("/api/ucenter.user/picker", data);
}

// 获取员工列表
export const getStaffListApi = async (data) => {
    return await apiRequest.post("/api/ucenter.user/staff", data);
}

// 添加用户
export const createUserApi = async (data) => {
    return await apiRequest.post("/api/ucenter.user/create", data);
}

// 读取用户信息
export const readUserApi = async (data) => {
    return await apiRequest.post("/api/ucenter.user/read", data);
}

// 编辑用户信息
export const updateUserApi = async (data) => {
    return await apiRequest.post("/api/ucenter.user/save", data);
}

// 更新用户密码
export const updateUserPasswordApi = async (data) => {
    return await apiRequest.post("/api/ucenter.user/password", data);
}

// 获取用户角色
export const getUserRoleApi = async (data) => {
    return await apiRequest.post("/api/ucenter.grant/roles", data);
}

// 设置用户角色
export const setUserRoleApi = async (data) => {
    return await apiRequest.post("/api/ucenter.grant/bindRole", data);
}

// 获取路由
export const getRoutesApi = async () => {
    return await apiRequest.post("/api/ucenter.grant/routes");
}

// 获取用户信息
export const getUserInfoApi = async () => {
    return await apiRequest.post("/api/ucenter.user/info");
}




